package com.hantanger.weblog.controller;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * RSS
 * @author lys
 *
 */
public class RsdController extends BaseController {
	
	@Override
	public String doGet(HttpServletRequest request, HttpServletResponse response) {
		Map<String,Object> data = new HashMap<String,Object>();
		data.put("blogLink", getSpaceUrl());
		response.setContentType(XML);
		String rss =  getStringMerger().mergeTemplate(data, "/metaweblog/rsd.ftl");
		
		try {
			PrintWriter writer = response.getWriter();
			writer.write(rss);
			writer.flush();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		return null;
	}
}
